var days = 0,
	hours = 0,
	mins = 0,
	secs = 0;
var time;
var temp = 0;
var deadDay = null;
var curDay = null;
var strDateTime = "";
var strCurTime = "";
var remainTime = 0;

/*function countTime() {    
    deadDay = new Date(strDateTime);
    curDay = new Date();
    var remainTime = deadDay - curDay;
    days = parseInt(remainTime / 3600000 / 24); //3600 giay (1 gio)

    remainTime = remainTime - parseInt(days) * 3600000 * 24;
    hours = parseInt(remainTime / 3600000);
    if (hours + days > 0) {
        $("BuyerHours").innerHTML = '<strong class="safeUp">' + (hours + (days * 24)) + '</strong>';
    }
    else {
        $("BuyerHours").innerHTML = '<strong class="safeUp">' + 0 + '</strong>';
    }
    remainTime = remainTime - hours * 3600000;
    mins = parseInt(remainTime / 60000); //60 giay
    if (hours + days + mins > 0) {
        $("BuyerMins").innerHTML = '<strong class="safeUp">' + mins + '</strong>';
    }
    else {
        $("BuyerMins").innerHTML = '<strong class="safeUp">' + 0 + '</strong>';
    }
    remainTime = remainTime - mins * 60000;
    secs = parseInt(remainTime / 1000);
    if (secs + days + hours + mins > 0) {
        $("BuyerSecs").innerHTML = '<strong class="safeUp">' + secs + '</strong>';
    }
    else {
        $("BuyerSecs").innerHTML = '<strong class="safeUp">' + 0 + '</strong>';
    }
    if (secs > 0) {
        secs = secs - 1;
        $("BuyerSecs").innerHTML = '<strong class="safeUp">' + secs + '</strong>';
        time = setTimeout("countTime()", 1000);
        return;
    }
    if (mins > 0) {
        mins = mins - 1;
        secs = 59;
        $("BuyerSecs").innerHTML = '<strong class="safeUp">' + secs + '</strong>';
        $("BuyerMins").innerHTML = '<strong class="safeUp">' + mins + '</strong>';
        time = setTimeout("countTime()", 1000);
        return;
    }
    if (hours > 0) {
        hours = hours - 1;
        mins = 59;
        secs = 59;
        $("BuyerSecs").innerHTML = '<strong class="safeUp">' + secs + '</strong>';
        $("BuyerMins").innerHTML = '<strong class="safeUp">' + mins + '</strong>';
        $("BuyerHours").innerHTML = '<strong class="safeUp">' + hours + '</strong>';
        time = setTimeout("countTime()", 1000);
        return;
    }
    if (days > 0) {
        days = days - 1;
        hours = 23;
        mins = 59;
        secs = 59;
        $("BuyerSecs").innerHTML = '<strong class="safeUp">' + secs + '</strong>';
        $("BuyerMins").innerHTML = '<strong class="safeUp">' + mins + '</strong>';
        $("BuyerHours").innerHTML = '<strong class="safeUp">' + hours + '</strong>';
        time = setTimeout("countTime()", 1000);
        return;
    }
}*/
function countTime() {
    //deadDay = new Date(strDateTime);
    //curDay = new Date();
    //var remainTime = deadDay - curDay;
    remainTime = remainTime - 1000;
    if (remainTime > 0) {
        hours = parseInt(remainTime / 3600000);
        mins = parseInt((remainTime - (hours * 3600000)) / 60000);
        secs = parseInt((remainTime - (hours * 3600000) - (mins * 60000)) / 1000);
        $("BuyerHours").innerHTML = '<strong class="safeUp">' + hours + '</strong>';
        $("BuyerMins").innerHTML = '<strong class="safeUp">' + mins + '</strong>';
        $("BuyerSecs").innerHTML = '<strong class="safeUp">' + secs + '</strong>';
        time = setTimeout("countTime()", 1000);
        //return;
    } else {

        clearTimeout(time);
        window.location.reload();
    }



}